

<%@ page import="com.pandorasoft.shiro.ShiroModule" %>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="layout" content="kickstart" />
	<g:set var="entityName" value="${message(code: 'shiroModule.label', default: 'ShiroModule')}" />
	<title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>

<body>

<section id="edit" class="first">

	<g:hasErrors bean="${shiroModuleInstance}">
	<div class="alert alert-error">
		<g:renderErrors bean="${shiroModuleInstance}" as="list" />
	</div>
	</g:hasErrors>

	<g:form method="post" class="form-horizontal" >
		<g:hiddenField name="id" value="${shiroModuleInstance?.id}" />
		<g:hiddenField name="version" value="${shiroModuleInstance?.version}" />
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'name', 'error')}">
							<label for="name"><g:message code="shiroModule.name.label" default="Name" /></label>
							<div class="controls">
								<g:textField name="name" value="${shiroModuleInstance?.name}" />
								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'name', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'controllerName', 'error')}">
							<label for="controllerName"><g:message code="shiroModule.controllerName.label" default="Controller Name" /></label>
							<div class="controls">
								<g:textField name="controllerName" value="${shiroModuleInstance?.controllerName}" />
								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'controllerName', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'actionName', 'error')}">
							<label for="actionName"><g:message code="shiroModule.actionName.label" default="Action Name" /></label>
							<div class="controls">
								<g:textField name="actionName" value="${shiroModuleInstance?.actionName}" />
								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'actionName', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'root', 'error')}">
							<label for="root"><g:message code="shiroModule.root.label" default="Root" /></label>
							<div class="controls">
								<g:select name="root" from="${shiroModuleInstance.constraints.root.inList}" value="${shiroModuleInstance?.root}" valueMessagePrefix="shiroModule.root"  />
								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'root', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'parent', 'error')}">
							<label for="parent"><g:message code="shiroModule.parent.label" default="Parent" /></label>
							<div class="controls">
								<g:select name="parent.id" from="${com.pandorasoft.shiro.ShiroModule.list()}" optionKey="id" value="${shiroModuleInstance?.parent?.id}" noSelection="['null': '']" />
								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'parent', 'error')}</span>
							</div>
						</div>
				
						<div class="control-group ${hasErrors(bean: shiroModuleInstance, field: 'childrens', 'error')}">
							<label for="childrens"><g:message code="shiroModule.childrens.label" default="Childrens" /></label>
							<div class="controls">
								
<ul>
<g:each in="${shiroModuleInstance?.childrens?}" var="c">
    <li><g:link controller="shiroModule" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="shiroModule" action="create" params="['shiroModule.id': shiroModuleInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'shiroModule.label', default: 'ShiroModule')])}</g:link>

								<span class="help-inline">${hasErrors(bean: shiroModuleInstance, field: 'childrens', 'error')}</span>
							</div>
						</div>
				
		<div class="form-actions">
			<g:actionSubmit class="save btn-primary" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
			<g:actionSubmit class="delete btn-danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
            <button class="btn" type="reset">Cancel</button>
		</div>
	</g:form>

</section>
			
</body>

</html>
